package core

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type Api struct {
}

func (e *Api) Success(c *gin.Context, data any) {
	c.JSON(http.StatusOK, gin.H{"code": 0, "data": data, "msg": "success"})
}

func (e *Api) Error(c *gin.Context, code int, msg string) {
	c.JSON(http.StatusOK, gin.H{"code": code, "msg": msg})
}
